package demo;

import static java.lang.Thread.sleep;

public class Main {
    static class subThread extends Thread{

        @Override
        public void run() {
            while(true){
                System.out.println("子线程B");

            }
        }
    }
    public static void main(String[] args)  {
        //创建子线程对象
        subThread sub=new subThread();
        //子线程开始
        sub.start();

        while(true){
            System.out.println("主线程A");

        }
    }
}
